#!/bin/bash

wget -P /tmp/ https://solution-as-code-publicbucket.obs.cn-north-4.myhuaweicloud.com/ZPan/cloudexplorer-offline-installer-v1.0.2-x86_64.tar.gz
tar -zxvf /tmp/cloudexplorer-offline-installer-v1.0.2-x86_64.tar.gz -C /tmp
mv /tmp/cloudexplorer-offline-installer-v1.0.2-x86_64/ /tmp/cloudexplorer/
sed -i -e 's/CE_EXTERNAL_MYSQL=false/CE_EXTERNAL_MYSQL=true/' \
-e "s/CE_MYSQL_HOST=mysql/CE_MYSQL_HOST=$1/" \
-e "s/CE_MYSQL_PASSWORD=Password123@mysql/CE_MYSQL_PASSWORD=$2/" /tmp/cloudexplorer/install.conf
cd /tmp/cloudexplorer || exit
bash install.sh